package com.coder.plugin

import org.gradle.api.Plugin
import org.gradle.api.Project

/**
 * @description TODO
 * @author yuhus
 * @date 2021/9/30 12:39
 */
class ASMPlugin : Plugin<Project> {
    override fun apply(project: Project) {
        println("========================")
        println("hello gradle ASMPlugin!")
        println("========================")

        project.extensions.create("asm", ASMExtension::class.java)

        project.afterEvaluate {
            val asmExt = project.extensions.getByType(ASMExtension::class.java)
            println("asm extensions, asmExt=${asmExt}")
        }

        project.tasks.create("asm-task") {
            it.group = "asm"
        }
    }
}